package com.yzy.fly.util.asm;

public class MyClassLoader extends ClassLoader {
    @Override
    protected Class<?> findClass(String name) throws ClassNotFoundException {
//        if ("sample.HelloWorld".equals(name)) {
        if ("com.yzy.bi.entity.core.Test".equals(name)) {
//            byte[] bytes = ASMUtil.dump();
            byte[] bytes = new byte[0];
            try {
                bytes =  TestDumpNew.dump();
            } catch (Exception e) {
                e.printStackTrace();
            }
            Class<?> clazz = defineClass(name, bytes, 0, bytes.length);
            return clazz;
        }

        throw new ClassNotFoundException("Class Not Found: " + name);
    }
}